<template>
    <div class="home">
    

    <wv-flex :gutter="10" class="top">

        <wv-flex-item>
            <div class="placeholder"><div class="num">20</div><span>本月新增门店</span></div>
        </wv-flex-item>
        <wv-flex-item>
            <div class="placeholder"><div class="num">20</div><span>本月商品订单数</span></div>
        </wv-flex-item>
        <wv-flex-item>
            <div class="placeholder"><div class="num">20</div><span>本月洗涤订单数</span></div>
        </wv-flex-item>
    </wv-flex>
    <wv-grid class="main">
        <div v-if="type === 3">
            <wv-grid-item to="/index">
                <img src="../../static/img/new.png" slot="icon">
                <span slot="label">新增BD</span>
            </wv-grid-item>
            <wv-grid-item to="/index">
                <img src="../../static/img/look.png"  slot="icon">
                <span slot="label">BD列表</span>
            </wv-grid-item>
            <wv-grid-item>
                <img src="../../static/img/xiadan.png"  slot="icon">
                <span slot="label">门店列表</span>
            </wv-grid-item>
            <wv-grid-item to="/index">
                <img src="../../static/img/list.png"  slot="icon">
                <span slot="label">商品订单列表</span>
            </wv-grid-item>
            <wv-grid-item @click="onClick">
                <img src="../../static/img/dingdan.png"  slot="icon">
                <span slot="label">洗涤订单列表</span>
            </wv-grid-item>
            <wv-grid-item @click="onClick">
                <img src="../../static/img/shangpin.png"  slot="icon">
                <span slot="label">订货单列表</span>
            </wv-grid-item>
            <wv-button type="primary" @click="toOrder">一键下单洗涤</wv-button>
        </div>
        <div v-else-if="type === 4">
            <wv-grid-item to="/bdindex">
                <img src="../../static/img/new.png" slot="icon">
                <span slot="label">门店开户</span>
            </wv-grid-item>
            <wv-grid-item to="/bdindex">
                <img src="../../static/img/look.png"  slot="icon">
                <span slot="label">门店列表</span>
            </wv-grid-item>
            <wv-grid-item>
                <img src="../../static/img/xiadan.png"  slot="icon">
                <span slot="label">商品订单列表</span>
            </wv-grid-item>
            <wv-grid-item>
                <img src="../../static/img/xiadan.png"  slot="icon">
                <span slot="label">洗涤订单列表</span>
            </wv-grid-item>
            <wv-grid-item>
                <img src="../../static/img/xiadan.png"  slot="icon">
                <span slot="label">商品列表</span>
            </wv-grid-item>
        </div>
        <tabbar :type="type"></tabbar>
    </wv-grid>      
    </div>
</template>

<script>
import info from '../info.js'
import tabbar from '../views/tabbar'
export default {
  name: "home",
  data(){
      return{
          type: Number(this.$route.query.type)
      }
  },
  methods: {
    onClick () {
      console.log('click')
    },
    toOrder (){
        
        this.$router.push({path:'/orderWashing'})
    }
  },
  created() {
      console.log("type="+this.$route.query.type+"==="+this.type)
  },
  components: {
    tabbar
  },
 
  
};
</script>


<style lang="scss">
@import '../base/reset.scss';
@import "../base/common.scss";

.home {
    font-size: pxTorem(24);
    .top {
        /* background:#2aa515; */
        /* color:white; */
        .weui-flex__item{
            .placeholder {
                padding: pxTorem(40) 0;
                .num {
                    font-size:pxTorem(52);
                    font-weight:bold;
                    padding-bottom:pxTorem(20);
                }
            }
        }
        
    }
    .main {
        margin-bottom: pxTorem(104);
        .weui-grid {
            height:pxTorem(248);
            padding:pxTorem(60) pxTorem(20);
            .weui-grid__label {
                margin-top: pxTorem(20);
                /* font-size:pxTorem(28) */
            }
        }
        .weui-btn_primary {
            width: pxTorem(320);
            height: pxTorem(60);
            font-size: pxTorem(28);
            border-radius: pxTorem(100);
            margin-top: pxTorem(80);
            display: inline-block;
            line-height: 30px;
        }
    }
}


</style>